1. Field of the Invention
The present invention relates to a method and an apparatus for verifying a multiplexing schedule of digital signals which are suitable to scheduling executed when multiplexing the digital signals, and an apparatus for multiplexing digital signals.
2. Description of the Related Art
Today, an image signal and a speech signal are compressed according to the MPEG (Moving Picture Coding Experts Group) standards compressing system. Then, the compressed signals (elementary streams) compose a multiplexed stream. The multiplexed stream is recorded on a recording medium Further, a multiplexed stream recorded on the recording medium is reproduced by a reproducing apparatus so that the multiplexed stream may be separated into the original elementary streams, from each of which the image signal and the speech signal are decoded.
The method for separating the multiplexed stream into elementary streams is regulated according to the ISO (International Organization for Standardization) 13818-1 or 11172-1, for example. This separating method employs an ideal decoder and is termed a STD (System Target Decoder) model.
The time-divisional multiplexed elementary streams are applied to the STD model. The multiplexed stream is applied to the STD model at regular times by decoding a clock reference that is encoded time information (termed SCR: System Clock Reference).
The multiplexed stream applied to the STD model is divided into the elementary streams by a switch 100 as shown in FIG. 1. Those elementary streams are supplied to the corresponding buffers 101 to 104.
The rate information encoded in the multiplexed stream (termed MUX_rate) is supplied to the buffers selected by the switch. The input to the buffer not selected by the switch 100 is 0.
The elementary stream is pulled out of the buffer at each access unit that is a decoding unit defined for each elementary stream. At a decoding time of the access unit that is another piece of time information encoded in the stream, the data of the access unit is instantly pulled out of the buffer and then is supplied to the decoders 106 to 109. This decoding time guarantees the synchronization among the elementary streams.
For example, for the so-called I picture or P picture, the video data decoded by the decoder 106 is output through a reorder buffer 110, a selected terminal, and a switch 111. For the so-called B picture, the video data is output through another selected terminal and the switch 111. The other data such as the audio data and the subtitle data decoded by the decoders 107 to 109 are directly output.
The time-divisional multiplexing scheduling is executed without overflowing or underflowing the buffers 101 to 104. Further, the proper clock reference is required to be encoded in the multiplexed stream.
As shown in FIGS. 2A and 2B, the multiplexed stream is composed of packets, each packet containing the data of the single elementary stream. The set of the packets composes a pack. The size of the packet or the pack is optional and is ordinarily determined according to a transmission/storage medium.
The pack header contains the SCR that is the reference time of the STD and the MUX_rate encoded therein as additional information. The input rate to the STD model may be variable for each pack according to the MUX_rate encoded on the pack header. Further, the packet header contains time points when the following access units are decoded (termed a DTS Decoding Time stamp) encoded therein. The STD model is executed to reset an internal clock (termed an STC: System Time Clock) to the SCR when the SCR is input to the model. The SCR is required to be inserted to the STD model at intervals of 0.7 sec or shorter.
As shown in FIG. 2C, assume that the input of the multiplexed stream to the STD model is executed at the MUX_rate. When the STD model reads the SCR1 as a value of the SCR inside of the pack header, the STD model serves to set the STC to a value of the SCR1. When the STC is counted up to the same value of the SCR1, the STD model starts to read the data ES1 to the buffer 101 and continues to read the data ES1 until all data is read out of the packet. When the STD model reads the DTS1 as a value of the DTS, as shown in FIG. 2D, the data of the access units stored in the buffer 101 is pulled out at a time point indicated by the DTS1.
On the other hand, the buffer 102 is served to read the data ES2 when the STC value is counted up to the value of the SCR2, for example. When the STD model reads the DTS2, as shown in FIG. 2E, at the time point indicated by the DTS2, the data of the access units stored in the buffer 102 is pulled out.
At this time, the amount of the data occupying each buffer is equal to or smaller than a buffer size and the data of the access units decoded at the decoding time point have been already applied in the buffer. Hence, the multiplexing schedule is considered proper.
However, if the amount of data occupying the buffer is too larger or too small, the buffer may be broken.
For example, and with reference to FIGS. 3A-3E (wherein FIGS. 3A-3C are substantially identical to FIGS. 2A-2C and, in the interest of brevity, are not described again), if the amount of data occupying the buffer exceeds a given buffer size, the overflow takes place in the buffer. As shown in FIG. 3D, the buffer 101 is overflown while the packet (n, 1) is being input. The schedule in which the packet (n, 1) multiplexes the data ES1 does not satisfy the STD model.
On the other hand, as shown in FIG. 3E, for the data ES2, the data of the access units decoded at the decoding time points are not still completely applied to the buffer. This is an underflow of the buffer 102. The schedule in which the packet (n, 2) multiplexes the data ES2 is considered erroneous.
As mentioned above, in a case of executing the multiplexing schedule, it is essential to verify whether or not the multiplexed stream generated as a result of the schedule meets the STD model.
In order to verify whether or not the multiplexed stream meets the STD model, it is necessary to grasp the size and the decoding time point of the access unit and simulate the I/O operation of the buffer.
For the ISOs 13818-1 and 11172-1, the conditions the multiplexed stream meets are as follows.
The data does not stay within the buffer for one second or longer (one-second rule).
Less than 31 access units are allowed to be put in the buffer.
The verification is executed at each slit and the DTS (decoding time point).
The slit between the access units is identified by the start code for indicating the start of the start unit. For example, the access unit of the image signal encoded by the ISOs 13818-2 and 11172-2 is started at a four-byte start code.
For the method for detecting a slit between the access units from the data input to the buffer, there has been proposed a method for decoding the compressed data and detecting an end of the access unit and a method for detecting a start code of the access unit in the input data.
By the way, both of these methods are required to check for all data to be input to the buffer and consume long time. Further, the method for actually decoding all data needs an additional processing cost because the decoding is required.
On the other hand, in the method for detecting the start code, as shown in FIG. 4A, at the outset, the start codes are located serially on the elementary stream. As to the data divided into packets according to the multiplexing schedule, as shown in FIG. 4B, the access unit may be divided into one or more packets. Then, the stream time-divisionally multiplexed with the data of another elementary stream based on the multiplexing schedule is arranged so that the divided access units are multiplexed at remote locations as shown in FIG. 4C.
Concretely, as shown in FIG. 4C, it is impossible to know an end All of the previous access unit until a All time point when the start code is detected. Hence, it is necessary to verify the schedule after the verifying process is returned from the time point when All is detected to the time point when All is input.
Further, in a case that on the C11, the end of the access unit coincides with the end of the packet, until the start code is detected on the D11, it is impossible to determine that C11 is the end of the access unit.
In a case that a decode of the access unit takes place between the C11 and the D11, since the size of the access unit is unknown, it is impossible to verify the pull of the data from the buffer. For verifying it, therefore, the verifying process is required from when the D11 is detected back to when the C11 is input. In other words, it is necessary to pre-read the data until the next access unit start is detected.
That is, for verifying whether or not the multiplexed stream meets the STD model, it is necessary to actually decode the data and pre-read the data until the start of the next access unit is detected.
For the ISOs 13818-1 and 11172-1, the maximum value of the interval between the timestamps of the SCR is determined as the conditions the multiplexed stream should meet. Taking an example of the SCR, for verifying the interval between the serial SCRs with the multiplexed stream as an input, the start code of the pack header is detected in the data input to the STD model, and it is necessary to actually pull out of the field of the SCR encoded in the pack header. These operations are quite inconvenient.
The present invention is considered in the foregoing conditions, and it is an object of the present invention to provide a method and an apparatus for verifying a multiplexing schedule of digital signals and an apparatus for multiplexing the digital signals which are arranged to verify the multiplexing schedule without having to actually decode the data and pre-read the data until the start of the next access unit is detected.